from django.db import models

# Create your models here.


class Classroom(models.Model):
    order_number = models.IntegerField(verbose_name='序号')
    c_name = models.CharField(max_length=16, verbose_name='名称')
    Number_of_people = models.IntegerField(verbose_name='人数')
    c_judge = models.BooleanField(verbose_name='是否理论教室')
    c_img = models.FileField(default='',verbose_name='展示图片',upload_to='oaapp/')

    def __str__(self):
        return '%s' % self.c_name

    class Meta():
        verbose_name_plural = "班级管理"
class Equipment(models.Model):
    e_order_number = models.IntegerField(verbose_name='序号')
    e_name = models.CharField(max_length=16, verbose_name='设备名称')
    belong_id = models.ForeignKey('Classroom', on_delete=models.CASCADE,verbose_name='所属班级')
    e_img = models.FileField(default='', verbose_name='设备图片', upload_to='oaapp/')
    e_judge = models.BooleanField(verbose_name='是否正常')

    def __str__(self):
        return '%s' % self.e_name
    class Meta():
        verbose_name_plural = "设备管理"

class Hygiene(models.Model):
    h_order_number = models.IntegerField(verbose_name='序号')
    h_name = models.CharField(max_length=16, verbose_name='名称')
    h_hygiene = models.CharField(max_length=16, verbose_name='卫生情况')
    h_belong_id = models.ForeignKey('Classroom', on_delete=models.CASCADE, verbose_name='所属班级')
    h_admin = models.CharField(max_length=16, verbose_name='负责人')
    h_time = models.DateTimeField(verbose_name='时间')
    h_img = models.FileField(default='', verbose_name='卫生图片', upload_to='oaapp/')

    def __str__(self):
        return '%s' % self.h_name

    class Meta():
        verbose_name_plural = "卫生情况管理"



